home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / oath.lha / oath / test / bishift.cc < prev    next >
C/C++ Source or Header  |  1991-08-29  |  701b  |  24 lines

  1. #include "oath/bigInteger.h"
  2.  
  3. #include <iostream.h>
  4.  
  5. main(int argc, char **argv)
  6.    {if(argc != 3)
  7.        {cout << argv[0] << " shifts the first number by the second.\n";
  8.         cout << "Usage: " << argv[0] << " <bigInteger> <bigInteger>\n";
  9.         exit(1);
  10.        }
  11.  
  12.     bigIntegerA X = bigIntegerA::make(argv[1]);
  13.     bigIntegerA S = bigIntegerA::make(argv[2]);
  14.  
  15.     cout << "        X = " << X << endl;
  16.     cout << "        S = " << S << endl;
  17.  
  18.     cout << "(X <<= S) = " << (X <<= S) << endl;
  19.     cout << "(X <<= S) = " << (X <<= S) << endl;
  20.     cout << "(X >>= S) = " << (X >>= S) << endl;
  21.     cout << "(X >>= S) = " << (X >>= S) << endl;
  22.     cout << "(X >>= S) = " << (X >>= S) << endl;
  23.    }
  24.